﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace weighing
{
    /// <summary>
    /// 参数和值相等 返回True 否则 Flse;
    /// </summary>
    public class Int2BoolConverter : System.Windows.Data.IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value.ToString().Equals(parameter.ToString());
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
          return value.ToString().Equals(parameter.ToString()) ? parameter : 0;
        }
    }
}
